#!/bin/bash

# 构建项目
echo "正在构建项目..."
npm run build

# 检查是否安装了surge
if ! command -v surge &> /dev/null; then
    echo "正在安装 Surge..."
    npm install -g surge
fi

# 部署到surge
echo "正在部署到 Surge..."
cd dist
surge . home-decoration-app-$(date +%s).surge.sh

echo "部署完成！"